package com.hsy.swu

import android.content.Intent
import android.os.Bundle
import com.hsy.swu.databinding.ActivityLauncherBinding
import com.hsy.swu.hsyutils.HsyActivity
import com.hsy.swu.hsyutils.HsyViewModel
import com.hsy.swu.hsyutils.setFont
import com.hsy.swu.login.LoginActivity
import com.hsy.swu.version.Updater

class LauncherActivity : HsyActivity<ActivityLauncherBinding, HsyViewModel>() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        Updater.getUpdateInfoFromLeanCloud()
        mBinding.root.setFont()
        mBinding.tvTip.text = "帮帮通欢迎你"

        mBinding.root.animate()
            .setDuration(250)
            .setStartDelay(1000)
            .alpha(0f)
            .withEndAction {
                startActivity(Intent(this@LauncherActivity, LoginActivity::class.java))
                finish()
            }
            .start()
    }
}